home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2008 February / PCWFEB08.iso / Software / Freeware / Miro 1.0 / Miro_Installer.exe / chrome / content / checkboxtextbox_dialog.xul < prev    next >
Encoding:
Extensible Markup Language  |  2007-11-12  |  1.9 KB  |  46 lines

  1. <?xml version="1.0"?>
  2. <?xml-stylesheet href="chrome://global/skin" type="text/css"?>
  3. <?xml-stylesheet href="main.css" type="text/css"?>
  4.  
  5. <dialog id="democracy-dialog"
  6.     xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
  7.     xmlns:html="http://www.w3.org/1999/xhtml"
  8.         title=""
  9.         maxwidth="400"
  10.         buttons="accept,cancel"
  11.         ondialogaccept="onaccept();"
  12.         ondialogcancel="oncancel();"
  13.         onload="onload()">
  14.     <script type="text/javascript">
  15. function onload() {
  16.   var args = window.arguments[0];
  17.   var description = document.getElementById("description");
  18.   description.appendChild(document.createTextNode(args["description"]));
  19.   var dialog = document.getElementById("democracy-dialog");
  20.   document.title = args['title'];
  21.   dialog.getButton('accept').label = args['defaultLabel'];
  22.   dialog.getButton('cancel').label = args['otherLabel'];
  23.   var checkbox = document.getElementById('checkbox');
  24.   checkbox.checked = args['checkboxValue'];
  25.   checkbox.label = args['checkboxText'];
  26.   var textbox = document.getElementById('textbox');
  27.   textbox.value = args['textboxValue'];
  28. }
  29.  
  30. var pybridge = Components.classes["@participatoryculture.org/dtv/pybridge;1"].
  31.                 getService(Components.interfaces.pcfIDTVPyBridge);
  32. function onaccept() {
  33.   var value = document.getElementById('checkbox').checked;
  34.   var value2 = document.getElementById('textbox').value;
  35.   pybridge.handleCheckboxTextboxDialog(window.arguments[0]['id'], 0, value, value2);
  36. }
  37. function oncancel() {
  38.   var value = document.getElementById('checkbox').checked;
  39.   var value2 = document.getElementById('textbox').value;
  40.   pybridge.handleCheckboxTextboxDialog(window.arguments[0]['id'], 1, value, value2);
  41. }
  42.    </script>
  43.    <description id="description" />
  44.    <checkbox id="checkbox" />
  45.    <textbox id="textbox" multiline="true" rows="5"/>
  46. </dialog>